package com.iyundao.io.mapper;

import com.iyundao.io.model.ActivityJoinPeople;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface ActivityJoinPeopleMapper {
    @Insert({
        "insert into activityjoinpeople (id, activityid, ",
        "partymemberid)",
        "values (#{id,jdbcType=INTEGER}, #{activityid,jdbcType=INTEGER}, ",
        "#{partymemberid,jdbcType=INTEGER})"
    })
    int insert(ActivityJoinPeople record);

    @InsertProvider(type= ActivityJoinPeopleSqlProvider.class, method="insertSelective")
    int insertSelective(ActivityJoinPeople record);

    @Select("select * from activityjoinpeople where activityid=#{activityid,jdbcType=INTEGER} and partymemberid=#{partymemberid,jdbcType=INTEGER}")
    ActivityJoinPeople selectByDoubleId(ActivityJoinPeople activityJoinPeople);

    @Delete("delete from activityjoinpeople where activityid= #{activityid,jdbcType=INTEGER}")
    int del(Integer activityid);
}